package exam.zijie;

import java.util.Scanner;

public class test3 {
    static int[] p ;
    static int[] size;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int k = scanner.nextInt();
        int max = 0;
        p = new int[N+1];
        size = new int[N+1];
        for (int i = 1; i <= N; i++) {
            p[i] = i;
            size[i]=1;
        }
        for (int i = 0; i < k; i++) {
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            p[find(a)] = find(b);
            size[find(b)]+=size[find(a)];
            max = Math.max(max,size[find(b)]);
        }
        System.out.println(max);
    }

    public static int find(int x){
        if(p[x]!=x){
            p[x] = find(p[x]);
        }
        return p[x];
    }
}
